package com.lesso.lll.sunflower.domain.service;

import com.lesso.lll.sunflower.domain.repository.EmployeeRepository;
import com.lesso.lll.sunflower.infra.assembler.EmployeeAssembler;
import com.lesso.lll.sunflower.pojo.dto.EmployeeDTO;
import org.springframework.stereotype.Service;

/**
 * EmployeeDomainService
 *
 * @author lll
 * @since 2025-07-02
 */
@Service
public class EmployeeDomainService {

    private final EmployeeRepository employeeRepository;

    public EmployeeDomainService(EmployeeRepository employeeRepository) {
        this.employeeRepository = employeeRepository;
    }

    public Integer save(EmployeeDTO dto) {
        return employeeRepository.save(EmployeeAssembler.INSTANCE.dtoToEntity(dto));
    }
}
